home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Classes / PtrNumberLine / NumberLine.h < prev    next >
Encoding:
Text File  |  1992-06-01  |  1.9 KB  |  83 lines

  1. // By Judy D. Halchin, Educational Computing Services, Allegheny College.
  2. // You may freely copy, distribute and reuse this code. 
  3. // Allegheny College and the author disclaim any warranty of any kind, 
  4. // expressed or implied, as to its fitness for any particular use.
  5. // This work was partially supported by a Teacher Preparation grant from the 
  6. // National Science Foundation.
  7.  
  8. #import <appkit/View.h>
  9.  
  10. #define HORIZONTAL 0    // values for orientation
  11. #define VERTICAL   1
  12.  
  13. #define ABOVERIGHT     0   // values for labelPosition
  14. #define BELOWLEFT      1
  15.  
  16. @interface NumberLine:View
  17. {
  18.     int orientation, labelPosition;
  19.     BOOL endBars;
  20.     float linePosition;
  21.     float backgroundGray, lineGray, labelGray, borderWidth;
  22.     struct _tickInfo
  23.     {
  24.         float firstTick;
  25.         float tickSpacing;
  26.         int   numberOfTicks;
  27.         float firstLabel;
  28.         float labelSpacing;
  29.         int   numberOfLabels;
  30.         char  labelString[11][30];
  31.         char  expString[11][5];
  32.         BOOL  scientific;
  33.     } tickInfo;
  34.     id  numberLineNXImage;
  35. }
  36.  
  37. - initFrame:(NXRect *)frameRect;
  38. - drawSelf:(const NXRect *)rects :(int)rectCount;
  39. - drawIntoImage;
  40.  
  41. - numberLineNXImage;
  42.  
  43. - (float)max;
  44. - (float)min;
  45. - setMin:(float)newMin max:(float)newMax;
  46. - zoomIn:(float)multiplier;
  47. - zoomOut:(float)multiplier;
  48.  
  49. - (float)center;
  50. - setCenter:(float)newCenter;
  51. - slide:(float)translation;
  52.  
  53. - (float)linePosition;
  54. - setLinePosition:(float)newPostion;
  55.  
  56. - setBackgroundGray:(float)gray;
  57. - setLineGray:(float)gray;
  58. - setLabelGray:(float)gray;
  59. - (float)backgroundGray;
  60. - (float)lineGray;
  61. - (float)labelGray;
  62.  
  63. - (int)orientation;
  64.  
  65. - (int)labelPosition;
  66. - setLabelPosition:(int)newPosition;
  67.  
  68. - setBordered:(BOOL)shouldHaveBorder width:(float)width;
  69. - (BOOL)bordered;
  70. - setEndBars:(BOOL)shouldHaveEndBars;
  71. - (BOOL)hasEndBars;
  72.  
  73. - calculateTicks;
  74.  
  75. - setFrame:(const NXRect *)frameRect;
  76.  
  77. - read:(NXTypedStream *)typedStream;
  78. - write:(NXTypedStream *)typedStream;
  79. - awake;
  80. - (const char*)inspectorName;
  81.  
  82. @end
  83.